import sys
from disn.settings import ClAWLER_SCHEDULE_INTERVAL, DEBUG, redis_url

# http://docs.celeryproject.org/en/v2.3.3/userguide/periodic-tasks.html
# CELERY_RESULT_BACKEND = 'redis://127.0.0.1:6379/5'
# BROKER_URL = 'redis://127.0.0.1:6379/6'

# BROKER_URL = 'redis://:Schenker123@127.0.0.1:6379/0'
BROKER_URL = redis_url

CELERY_TIMEZONE = 'Asia/Shanghai'

from datetime import timedelta

CELERYBEAT_SCHEDULE = {
    'update-share-expired': {
         'task': 'taskqueue.tasks.update_share_expired',
         'schedule': timedelta(seconds=3600 * 12)
    },
    'fetch-smzdm-faxian': {
         'task': 'taskqueue.tasks.fetch_smzdm_faxian',
         'schedule': timedelta(seconds=ClAWLER_SCHEDULE_INTERVAL)
        #  'args': (16, 16)
    },
}
